﻿// Copyright (c) egmkang wang. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace XServer.Config
{
    public partial class ExpBase
    {
        public int GetShipExp(int quality)
        {
            switch (quality)
            {
                case 2: return this.Ship2Exp;
                case 3: return this.Ship3Exp;
                case 4: return this.Ship4Exp;
                case 5: return this.Ship5Exp;
                case 6: return this.Ship6Exp;
            }
            return 0;
        }
    }

    public partial class HeroBase
    {
        public int GetLevelUp(int currentLevel)
        {
            var exp = Config.Get<ExpBase>(currentLevel);
            if (exp != null) return 0;
            return exp.Value.GetShipExp(this.Quality);
        }
    }
}
